Skip to content

feat: Add HTTP response status code matching support#1790

Draft
Copilot wants to merge 21 commits intomasterfrom
copilot/add-status-code-matching-support
Draft

feat: Add HTTP response status code matching support#1790
Copilot wants to merge 21 commits intomasterfrom
copilot/add-status-code-matching-support

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 6, 2026

  • Replaced messy history with clean feature-only changes from latest origin/master
  • src/v3/types.tsStatusCodeMatcher<T>, HTTPResponseStatusClass enum, V3Response.status widened
  • src/v3/matchers.tsmatchStatus(), isStatusCodeMatcher(), generic reify<T>()
  • src/common/matchingRules.tsconvertStatusMatcherToFFI()
  • src/v3/ffi.ts — status matching rules emitted in setResponseDetails
  • src/v4/http/types.ts — interface signatures updated to accept number | StatusCodeMatcher<number>
  • src/v4/http/interactionWithRequest.ts — implementation updated
  • src/v4/http/interactionWithPluginRequest.ts — implementation updated
  • src/v3/matchers.spec.tsmatchStatus tests using Vitest assertions
  • src/v4/http/interactionWithRequest.spec.ts — new Vitest test file with vi.fn mocks
  • npm run check:fix — clean
  • All 282 tests passing
  • CodeQL: 0 alerts
  • Diff vs master: exactly 9 feature files, no extraneous changes

Copilot AI linked an issue May 6, 2026 that may be closed by this pull request
2 tasks
Copilot AI and others added 4 commits May 6, 2026 04:50
Since we have consolidated to vitest, the jest and mocha regression
suites are actually not currently functional.

If we want, we can create dedicated tests for these later, but deleting
for now as I don't think they serve much benefit.

Signed-off-by: JP-Ellis <josh@jpellis.me>
…, StatusCodeMatcher)

Agent-Logs-Url: https://github.com/pact-foundation/pact-js/sessions/5ef516cc-a979-4b12-9ecf-06f58a7622be

Co-authored-by: mefellows <53900+mefellows@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for status code matching feat: Add HTTP response status code matching support May 6, 2026
Copilot AI requested a review from mefellows May 6, 2026 04:59
JP-Ellis and others added 7 commits May 6, 2026 18:48
Replace mocha with vitest for faster test running, and native TS
support. Also reduce the number of dependencies by switching to vitest's
own assertion library.

Signed-off-by: JP-Ellis <josh@jpellis.me>
Signed-off-by: JP-Ellis <josh@jpellis.me>
Not sure why this wasn't covered in CI before

Signed-off-by: JP-Ellis <josh@jpellis.me>
In particular, consolidate the x86 and ARM tests into one job now that
we have ARM runners available.

Signed-off-by: JP-Ellis <josh@jpellis.me>
Helps with cross-platform support, in case `bash` is not available or
easily invoked (e.g., CI in Windows running in pwsh).

Signed-off-by: JP-Ellis <josh@jpellis.me>
Signed-off-by: JP-Ellis <josh@jpellis.me>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Copilot AI and others added 6 commits May 6, 2026 23:48
Co-authored-by: mefellows <53900+mefellows@users.noreply.github.com>
…, StatusCodeMatcher)

Agent-Logs-Url: https://github.com/pact-foundation/pact-js/sessions/5ef516cc-a979-4b12-9ecf-06f58a7622be

Co-authored-by: mefellows <53900+mefellows@users.noreply.github.com>
…est test

Co-authored-by: mefellows <53900+mefellows@users.noreply.github.com>
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.09317% with 24 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (master@e0be974). Learn more about missing BASE report.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/index.ts 0.00% 13 Missing ⚠️
src/v3/ffi.ts 25.00% 6 Missing ⚠️
src/v4/http/interactionWithPluginRequest.ts 44.44% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master    #1790   +/-   ##
=========================================
  Coverage          ?   60.87%           
=========================================
  Files             ?       67           
  Lines             ?     4187           
  Branches          ?      354           
=========================================
  Hits              ?     2549           
  Misses            ?     1636           
  Partials          ?        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…seStatusClass, StatusCodeMatcher)

Co-authored-by: mefellows <53900+mefellows@users.noreply.github.com>
Copilot AI and others added 2 commits May 8, 2026 03:29
…-support' into copilot/add-status-code-matching-support

Co-authored-by: mefellows <53900+mefellows@users.noreply.github.com>
…ock.json to master

Co-authored-by: mefellows <53900+mefellows@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adding support for status code matching

4 participants